package com.Cheng.service;

import com.Cheng.dao.BookMapper;
import com.Cheng.pojo.Books;

import java.util.List;

/**
 * @Author Cheng
 * @Date 2022/4/10 15:54
 * service的impl是把mapper和service进行整合的文件。
 */
public class BookServiceImpl implements BookService{
    //Service调用dao层：组合Dao
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books book) {
        return bookMapper.addBook(book);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books book) {
        return  bookMapper.updateBook(book);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }



}
